package main

import "sort"

func findKthLargest(nums []int, k int) int {

	sort.Slice(nums, func(i, j int) bool {
		return nums[i] < nums[j]
	})
	caps := make(map[int]struct{})
	j := 1
	for i := 0; i < len(nums); {
		if _, ok := caps[nums[i]]; !ok {
			caps[nums[i]] = struct{}{}
			if j == k {
				return nums[i]
			} else {
				j++
			}
		}
	}
	return -1
}
func main() {

}
